package com.register.client.common;

public enum ServiceInstanceOperation {
    REGISTER("REGISTER","注册"),
    REMOVE("REMOVE","删除");

    private String code;

    private String des;

    ServiceInstanceOperation(String code, String des) {
        this.code = code;
        this.des = des;
    }

    /**
     * 通过code查询枚举
     * @param value
     * @return
     */
    public static ServiceInstanceOperation findByCode(String value) {
        for (ServiceInstanceOperation approvalTypeEnum : ServiceInstanceOperation.values()) {
            if (approvalTypeEnum.getCode().equalsIgnoreCase(value)) {
                return approvalTypeEnum;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getDes() {
        return des;
    }
}
